package org.grapes.wine.api.client.method.impl;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

import org.grapes.wine.api.bean.GetFeaturedCourseDaysNumBean;
import org.grapes.wine.api.client.exception.WineException;
import org.grapes.wine.api.method.EWineMethod;
import org.grapes.wine.api.method.iface.IMethodGetFeaturedCourseDaysNum;
import org.xml.sax.SAXException;

public class MethodGetFeaturedCourseDaysNum extends CallWineMethod implements
		IMethodGetFeaturedCourseDaysNum {

	public MethodGetFeaturedCourseDaysNum(String apiKey, String sessionKey, String sig) {
		super(apiKey, sessionKey, sig);
		// TODO Auto-generated constructor stub
	}

	@Override
	public int getFeaturedCourseDaysNum(String featuredCourseName) {
		Map param = new HashMap();
		param.put("featuredCourseName", featuredCourseName);
		try {
			GetFeaturedCourseDaysNumBean bean = (GetFeaturedCourseDaysNumBean) callMethod(
					EWineMethod.GET_FEATURED_COURSE_DAYSNUM, param);
			return bean.getFeaturedCourseDaysNum();
		} catch (WineException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (SAXException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return 0;
	}

}
